using System;
using System.ComponentModel;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "TimeStampType")]
    public class TimeStamp : TimePrimitive
	{
        private string whenField;

        [XmlElement(ElementName = "when", DataType = "string")]
        public string When
        {
            get { return this.whenField; }
            set { this.whenField = value; }
        }

        public DateTime WhenDate
        {
            get { return System.Xml.XmlConvert.ToDateTime(this.whenField, System.Xml.XmlDateTimeSerializationMode.Utc); }
            set { this.whenField = System.Xml.XmlConvert.ToString(value, System.Xml.XmlDateTimeSerializationMode.Utc); }
        }
    }

}